import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    activeComponent: null, // 当前显示的组件
    showWelcome: true      // 是否显示欢迎语
  },
  mutations: {
    setActiveComponent(state, component) {
      state.activeComponent = component;
      state.showWelcome = false;
    },
    resetContent(state) {
      state.activeComponent = null;
      state.showWelcome = true;
    }
  }
});